package com.oriental.manage.core.utils;

import com.oriental.opcif.common.util.AssertResultUtils;

/**
 * Author: yutao
 * Date: 2017/4/27
 * Time: 10:22
 * Desc：
 */
public class StringUtils {

    private StringUtils(){
    }

    public static String getSubMessage(String message,String startMessage,String endMessage){
        int start = message.indexOf(startMessage);
        int end = message.indexOf(endMessage);
        AssertResultUtils.checkUpdZero(start);
        AssertResultUtils.checkUpdZero(end);
        return message.substring(start + startMessage.length(),end);
    }

    public static String getSubStr(String message,String startMessage,String endMessage){
        int start = message.indexOf(startMessage);
        int end = message.indexOf(endMessage);

        return message.substring(start + startMessage.length(),end).trim();
    }

}

